import request from '@/config/axios'

// 树洞打卡 VO
export interface UserTreeHoleClockVO {
  id: number // 主键
  type: boolean // 打卡类型（0睡觉打卡 1起床打卡）
  clockTime: Date // 打卡时间
  createDate: Date // 创建日期
  remark: string // 备注
}

// 树洞打卡 API
export const UserTreeHoleClockApi = {
  // 查询树洞打卡分页
  getUserTreeHoleClockPage: async (params: any) => {
    return await request.get({ url: `/business/user-tree-hole-clock/page`, params })
  },

  // 查询树洞打卡详情
  getUserTreeHoleClock: async (id: number) => {
    return await request.get({ url: `/business/user-tree-hole-clock/get?id=` + id })
  },

  // 新增树洞打卡
  createUserTreeHoleClock: async (data: UserTreeHoleClockVO) => {
    return await request.post({ url: `/business/user-tree-hole-clock/create`, data })
  },

  // 修改树洞打卡
  updateUserTreeHoleClock: async (data: UserTreeHoleClockVO) => {
    return await request.put({ url: `/business/user-tree-hole-clock/update`, data })
  },

  // 删除树洞打卡
  deleteUserTreeHoleClock: async (id: number) => {
    return await request.delete({ url: `/business/user-tree-hole-clock/delete?id=` + id })
  },

  // 导出树洞打卡 Excel
  exportUserTreeHoleClock: async (params) => {
    return await request.download({ url: `/business/user-tree-hole-clock/export-excel`, params })
  },
}